<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>权限管理 - 权限管理系统</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
    <style>
        :root {
            --primary-color: #667eea;
            --secondary-color: #764ba2;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: #f8fafc;
        }

        .sidebar {
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
            color: white;
            height: 100vh;
            position: fixed;
            width: 280px;
            box-shadow: 5px 0 15px rgba(0,0,0,0.1);
            z-index: 1000;
        }

        .main-content {
            margin-left: 280px;
            padding: 30px;
            min-height: 100vh;
        }

        .nav-link {
            color: rgba(255,255,255,0.9) !important;
            padding: 15px 25px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
            transition: all 0.3s ease;
            font-weight: 500;
        }

        .nav-link:hover {
            background: rgba(255,255,255,0.15);
            padding-left: 30px;
            color: white !important;
        }

        .nav-link.active {
            background: rgba(255,255,255,0.2);
            border-left: 4px solid white;
            color: white !important;
        }

        .card {
            border: none;
            border-radius: 15px;
            box-shadow: 0 5px 20px rgba(0,0,0,0.08);
            margin-bottom: 25px;
            transition: all 0.3s ease;
        }

        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 30px rgba(0,0,0,0.15);
        }

        .role-card {
            cursor: pointer;
            border-left: 4px solid var(--primary-color);
        }

        .menu-tree {
            list-style: none;
            padding-left: 0;
        }

        .menu-item {
            padding: 10px 15px;
            border-radius: 8px;
            background: #f8f9fa;
            margin: 5px 0;
            border-left: 3px solid var(--primary-color);
        }

        .menu-children {
            padding-left: 25px;
            margin-top: 8px;
        }

        .menu-icon {
            width: 30px;
            text-align: center;
            margin-right: 10px;
        }

        .role-badge {
            font-size: 0.75rem;
            padding: 4px 8px;
        }
    </style>
</head>
<body>
<!-- 侧边栏 -->
<div class="sidebar">
    <div class="p-4">
        <div class="d-flex align-items-center mb-3">
            <div style="width: 50px; height: 50px; border-radius: 12px; background: white; display: flex; align-items: center; justify-content: center;" class="me-3">
                <i class="fas fa-shield-alt text-primary"></i>
            </div>
            <div>
                <h5 class="mb-0">权限管理系统</h5>
                <small class="opacity-75">权限管理</small>
            </div>
        </div>
        <p class="mb-0 text-light opacity-75">
            <i class="fas fa-user me-2"></i><span th:text="${currentUser.name}">用户</span>
        </p>
    </div>
    <nav class="nav flex-column">
        <a class="nav-link" href="/dashboard">
            <i class="fas fa-home me-3"></i>系统首页
        </a>
        <a class="nav-link" href="/user/management">
            <i class="fas fa-users me-3"></i>用户管理
        </a>
        <a class="nav-link active" href="/role/management">
            <i class="fas fa-user-shield me-3"></i>权限管理
        </a>
        <a class="nav-link" href="/user/profile">
            <i class="fas fa-user-cog me-3"></i>个人信息
        </a>
        <a class="nav-link" href="/logout">
            <i class="fas fa-sign-out-alt me-3"></i>退出登录
        </a>
    </nav>
</div>

<!-- 主内容区 -->
<div class="main-content">
    <div class="d-flex justify-content-between align-items-center mb-4">
        <div>
            <h2 class="mb-1">
                <i class="fas fa-user-shield me-2 text-primary"></i>权限管理
            </h2>
            <p class="text-muted mb-0">管理系统角色和权限分配</p>
        </div>
        <button class="btn btn-primary">
            <i class="fas fa-plus me-2"></i>新增角色
        </button>
    </div>

    <div class="row">
        <!-- 角色列表 -->
        <div class="col-md-4">
            <div class="card">
                <div class="card-header bg-primary text-white">
                    <h5 class="mb-0"><i class="fas fa-list me-2"></i>角色列表</h5>
                </div>
                <div class="card-body">
                    <div class="list-group">
                        <a th:href="@{/role/detail(roleId=1)}" class="list-group-item list-group-item-action role-card">
                            <div class="d-flex justify-content-between align-items-center">
                                <div>
                                    <i class="fas fa-crown me-2 text-warning"></i>
                                    <strong>超级管理员</strong>
                                    <div class="text-muted small mt-1">super_admin</div>
                                </div>
                                <span class="badge bg-danger">最高权限</span>
                            </div>
                        </a>
                        <a th:href="@{/role/detail(roleId=2)}" class="list-group-item list-group-item-action role-card">
                            <div class="d-flex justify-content-between align-items-center">
                                <div>
                                    <i class="fas fa-user-cog me-2 text-info"></i>
                                    <strong>系统管理员</strong>
                                    <div class="text-muted small mt-1">admin</div>
                                </div>
                                <span class="badge bg-warning">管理权限</span>
                            </div>
                        </a>
                        <a th:href="@{/role/detail(roleId=3)}" class="list-group-item list-group-item-action role-card">
                            <div class="d-flex justify-content-between align-items-center">
                                <div>
                                    <i class="fas fa-user-tie me-2 text-success"></i>
                                    <strong>部门经理</strong>
                                    <div class="text-muted small mt-1">manager</div>
                                </div>
                                <span class="badge bg-success">部门权限</span>
                            </div>
                        </a>
                        <a th:href="@{/role/detail(roleId=4)}" class="list-group-item list-group-item-action role-card">
                            <div class="d-flex justify-content-between align-items-center">
                                <div>
                                    <i class="fas fa-user me-2 text-secondary"></i>
                                    <strong>普通员工</strong>
                                    <div class="text-muted small mt-1">employee</div>
                                </div>
                                <span class="badge bg-info">基础权限</span>
                            </div>
                        </a>
                    </div>
                </div>
            </div>
        </div>

        <!-- 角色详情 -->
        <div class="col-md-8">
            <div class="card">
                <div class="card-header bg-success text-white">
                    <h5 class="mb-0">
                        <i class="fas fa-info-circle me-2"></i>
                        角色权限详情
                    </h5>
                </div>
                <div class="card-body">
                    <div class="text-center py-5">
                        <i class="fas fa-user-shield fa-3x text-muted mb-3"></i>
                        <h5 class="text-muted">请选择角色查看详情</h5>
                        <p class="text-muted">点击左侧角色列表查看该角色的详细权限信息</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>